import java.util.concurrent.*;

public class FutureTest extends Thread{
    public static void main(String[]args) throws ExecutionException, InterruptedException {
       /* FutureTask<String> task=new FutureTask<>(()->{
            return Thread.currentThread().getName();
        });
        System.out.println(task.state());
        new Thread(task).start();
        System.out.println(task.state());
        System.out.println(task.get());
        System.out.println(task.state());
        System.out.println(Thread.currentThread().getName());
        Future a=ftest();
        System.out.println(a.get());*/
        FutureTest test=new FutureTest();
        test.start();
    }

    @Override
    public void run() {
        System.out.println("hello wo");
    }

    public static Future ftest(){
       return new futureTest();
    }

    static class futureTest implements Future{

        @Override
        public boolean cancel(boolean mayInterruptIfRunning) {
            return false;
        }

        @Override
        public boolean isCancelled() {
            return false;
        }

        @Override
        public boolean isDone() {
            return false;
        }

        @Override
        public Object get() throws InterruptedException, ExecutionException {
            return null;
        }

        @Override
        public Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
            return null;
        }
    }
}
